//
//  LCHeadView.m
//  EnterpriseCloud
//
//  Created by 东亨 on 2017/7/7.
//  Copyright © 2017年 lichao. All rights reserved.
//

#import "LCHeadView.h"
@implementation LCHeadView
- (instancetype)initWithTitle:(NSString *)titleStr
{
    self = [super init];
    if (self)
    {
        self.frame = CGRectMake(0, 0, SCREEN_WIDTH, 40);
        self.backgroundColor = [UIColor whiteColor];
        UIView *verticalView = ({
            UIView *view = [[UIView alloc]init];
            [self addSubview:view];
            [view mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(10);
                make.top.mas_equalTo(8);
                make.bottom.mas_equalTo(-8);
                make.width.mas_equalTo(5);
            }];
        view;
        });
        verticalView.backgroundColor = [UIColor colorWithHex:0x8a2e22];
        UILabel *titleLbl = ({
            UILabel *lable = [[UILabel alloc]init];
            [self addSubview:lable];
            [lable mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(verticalView).offset(10);
                make.centerY.equalTo(verticalView);
            }];
            lable;
        });
        titleLbl.text = titleStr;
//        _lineView = ({
//            UIView *view = [[UIView alloc]init];
//            [self addSubview:view];
//            [view mas_makeConstraints:^(MASConstraintMaker *make) {
//                make.right.bottom.equalTo(self);
//                make.left.mas_equalTo(10);
//                make.height.mas_equalTo(1);
//            }];
//            view;
//        });
//        _lineView.backgroundColor = RGB(245, 245, 245);
     }
    return self;
}
@end
